import req from '@/utils/request'
import type { CategoryList } from './model/CategoryListType'
enum Api {
  category1 = '/admin/product/getCategory1',
  category2 = '/admin/product/getCategory2',
  category3 = '/admin/product/getCategory3',
}

// 获取一级分类列表
export const getCategory1List = () => {
  return req.get<null, CategoryList>(Api.category1)
}
// 获取二级分类列表
export const getCategory2List = (category1Id: number) => {
  return req.get<null, CategoryList>(`${Api.category2}/${category1Id}`)
}
// 获取三级分类列表
export const getCategory3List = (category2Id: number) => {
  return req.get<null, CategoryList>(`${Api.category3}/${category2Id}`)
}
